<template>

	<view class="content" style="padding-top: 40rpx;">
		<view class="box">
			<view class="leftbox">
				<image :src="list[0].url" @click="adJump(list[0])" mode=""></image>
			</view>
			<view class="rightbox">
				<view class="top_r">
					<image :src="list[1].url" @click="adJump(list[1])" mode=""></image>
				</view>
				<view class="bottom_r">
					<image :src="list[2].url" @click="adJump(list[2])" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getScene} from "@/plugins/utils.js" 
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import {
		loGetLocation
	} from '@/config/common';
	export default {
		components: {
		
		},
		computed: {
			...mapState(['PrimaryColor', `userInfo`]),
			freeSpecsButtonBackground() {
				return this.$u.colorToRgba(this.$u.rgbToHex(this.PrimaryColor), 0.75)
			},
		},
		data() {
			return {
			
			}
		},
		watch: {
			// //数据改变请求接口
			userInfo: {
				handler: function() {
					//请求接口
					if (this.userInfo.exhibitionBox && this.is_enabled) {
						this.activity_show = true
						this.getAddReceive()
						this.userInfo.exhibitionBox = false
						this.setUserInfo(this.userInfo)
					}
				},
				deep: true
			}

		},
		
	props:{
		
			list:{
			    type:Array,
			    default:[
				
				],
			},
		
		},
	
		async onLoad(e) {
		
		},
	

		methods: {
	
		
	
	// 跳转
	adJump(item){
		if (this.userInfo.token) {
			// 小程序跳转
			if (item.href && item.type == 3) {
				this.onAdJump(item)
			}
			// 跳转H5
			if (item.href && item.type == 2) {
				this.onJump('/pages/webview/webview?url=' + encodeURI('' + item.href))
			}
			// 跳转视频
			if (item.href && item.type == 1) {
				this.videoLook(item.href)
			}
			if (item.href && item.type == 6) {
				this.onAdJump(item)
			}
		} else {
			this.judgePhone()
		}
	},
		
	videoLook(url){
		let src = Array.isArray(url)? url[0]:url;
		uni.$u.route('/pagesCircle/video/look', 
		  {src:src},
		);
	},
	onAdJump(obj){
		wx.vibrateShort();
		
		if(obj.type==3&&!obj.appid&&obj.href){
			// 跳转小程序内部
			uni.navigateTo({
				url: obj.href,
				fail: function(res) {
					
				    uni.reLaunch({
				    	url:obj.href
				    })
				  }
			})
		}
		if(obj.type==6&&!obj.appid&&obj.href){
			// 跳转小程序内部
			uni.navigateTo({
				url: obj.href,
				fail: function(res) {
					
				    uni.reLaunch({
				    	url:obj.href
				    })
				  }
			})
		}
		
		// 外部小程序跳转
		if(obj.type==3&&obj.appid&&obj.href){
			// 跳转小程序内部
			uni.navigateToMiniProgram({
			    appId:obj.appid,
			    path:obj.href,
			    envVersion:"release",
			    success: res => {
			      // 打开成功
			      
			    },
			    fail: err => {
			      
			    }
			});
		}
		
	},
		
		
	
	},
}
</script>

<style lang="scss" scoped>
	.box{
		display: flex;
	}
	.leftbox{
		width: 340rpx;
		height: 560rpx;
		display: flex;
		image{
			height: 100%;
			width: 100%;
			border-radius: 12rpx;
		}
	}
	.rightbox{
		width: 350rpx;
		height: 560rpx;
		margin-left: 20rpx;
		.top_r{
			height: 220rpx;
			width: 100%;
			display: flex;
			image{
				height: 100%;
				width: 100%;
				border-radius: 12rpx;
			}
		}
		.bottom_r{
			margin-top: 20rpx;
			height: 320rpx;
			width: 100%;
			display: flex;
			image{
				height: 100%;
				width: 100%;
				border-radius: 12rpx;
			}
		}
	}
</style>